home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / doom / qplus10.zip / MISC.QC < prev    next >
Text File  |  1996-08-18  |  15KB  |  672 lines

  1.  
  2. /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4)
  3. Used as a positional target for spotlights, etc.
  4. */
  5. void() info_null =
  6. {
  7.     remove(self);
  8. };
  9.  
  10. /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
  11. Used as a positional target for lightning.
  12. */
  13. void() info_notnull =
  14. {
  15. };
  16.  
  17. //============================================================================
  18.  
  19. float START_OFF = 1;
  20.  
  21. void() light_use =
  22. {
  23.     if (self.spawnflags & START_OFF)
  24.     {
  25.         lightstyle(self.style, "m");
  26.         self.spawnflags = self.spawnflags - START_OFF;
  27.     }
  28.     else
  29.     {
  30.         lightstyle(self.style, "a");
  31.         self.spawnflags = self.spawnflags + START_OFF;
  32.     }
  33. };
  34.  
  35. /*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  36. Non-displayed light.
  37. Default light value is 300
  38. Default style is 0
  39. If targeted, it will toggle between on or off.
  40. */
  41. void() light =
  42. {
  43.     if (!self.targetname)
  44.     {    // inert light
  45.         remove(self);
  46.         return;
  47.     }
  48.     
  49.     if (self.style >= 32)
  50.     {
  51.         self.use = light_use;
  52.         if (self.spawnflags & START_OFF)
  53.             lightstyle(self.style, "a");
  54.         else
  55.             lightstyle(self.style, "m");
  56.     }
  57. };
  58.  
  59. /*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  60. Non-displayed light.
  61. Default light value is 300
  62. Default style is 0
  63. If targeted, it will toggle between on or off.
  64. Makes steady fluorescent humming sound
  65. */
  66. void() light_fluoro =
  67. {
  68.     if (self.style >= 32)
  69.     {
  70.         self.use = light_use;
  71.         if (self.spawnflags & START_OFF)
  72.             lightstyle(self.style, "a");
  73.         else
  74.             lightstyle(self.style, "m");
  75.     }
  76.     
  77.     precache_sound ("ambience/fl_hum1.wav");
  78.     ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
  79. };
  80.  
  81. /*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8)
  82. Non-displayed light.
  83. Default light value is 300
  84. Default style is 10
  85. Makes sparking, broken fluorescent sound
  86. */
  87. void() light_fluorospark =
  88. {
  89.     if (!self.style)
  90.         self.style = 10;
  91.  
  92.     precache_sound ("ambience/buzz1.wav");
  93.     ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC);
  94. };
  95.  
  96. /*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8)
  97. Sphere globe light.
  98. Default light value is 300
  99. Default style is 0
  100. */
  101. void() light_globe =
  102. {
  103.     precache_model ("progs/s_light.spr");
  104.     setmodel (self, "progs/s_light.spr");
  105.     makestatic (self);
  106. };
  107.  
  108. void() FireAmbient =
  109. {
  110.     precache_sound ("ambience/fire1.wav");
  111. // attenuate fast
  112.     ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC);
  113. };
  114.  
  115. /*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
  116. Short wall torch
  117. Default light value is 200
  118. Default style is 0
  119. */
  120. void() light_torch_small_walltorch =
  121. {
  122.     precache_model ("progs/flame.mdl");
  123.     setmodel (self, "progs/flame.mdl");
  124.     FireAmbient ();
  125.     makestatic (self);
  126. };
  127.  
  128. /*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18)
  129. Large yellow flame ball
  130. */
  131. void() light_flame_large_yellow =
  132. {
  133.     precache_model ("progs/flame2.mdl");
  134.     setmodel (self, "progs/flame2.mdl");
  135.     self.frame = 1;
  136.     FireAmbient ();
  137.     makestatic (self);
  138. };
  139.  
  140. /*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  141. Small yellow flame ball
  142. */
  143. void() light_flame_small_yellow =
  144. {
  145.     precache_model ("progs/flame2.mdl");
  146.     setmodel (self, "progs/flame2.mdl");
  147.     FireAmbient ();
  148.     makestatic (self);
  149. };
  150.  
  151. /*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
  152. Small white flame ball
  153. */
  154. void() light_flame_small_white =
  155. {
  156.     precache_model ("progs/flame2.mdl");
  157.     setmodel (self, "progs/flame2.mdl");
  158.     FireAmbient ();
  159.     makestatic (self);
  160. };
  161.  
  162. //============================================================================
  163.  
  164.  
  165. /*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8)
  166. Lava Balls
  167. */
  168.  
  169. void() fire_fly;
  170. void() fire_touch;
  171. void() misc_fireball =
  172. {
  173.     
  174.     precache_model ("progs/lavaball.mdl");
  175.     self.classname = "fireball";
  176.     self.nextthink = time + (random() * 5);
  177.     self.think = fire_fly;
  178.     if (!self.speed)
  179.         self.speed == 1000;
  180. };
  181.  
  182. void() fire_fly =
  183. {
  184. local entity    fireball;
  185.  
  186.     fireball = spawn();
  187.     fireball.solid = SOLID_TRIGGER;
  188.     fireball.movetype = MOVETYPE_TOSS;
  189.     fireball.velocity = '0 0 1000';
  190.     fireball.velocity_x = (random() * 100) - 50;
  191.     fireball.velocity_y = (random() * 100) - 50;
  192.     fireball.velocity_z = self.speed + (random() * 200);
  193.     fireball.classname = "fireball";
  194.     setmodel (fireball, "progs/lavaball.mdl");
  195.     setsize (fireball, '0 0 0', '0 0 0');
  196.     setorigin (fireball, self.origin);
  197.     fireball.nextthink = time + 5;
  198.     fireball.think = SUB_Remove;
  199.     fireball.touch = fire_touch;
  200.     
  201.     self.nextthink = time + (random() * 5) + 3;
  202.     self.think = fire_fly;
  203. };
  204.  
  205.  
  206. void() fire_touch =
  207. {
  208.     T_Damage (other, self, self, 20);
  209.     remove(self);
  210. };
  211.  
  212. //============================================================================
  213.  
  214.  
  215. void() barrel_explode =
  216. {
  217.     self.takedamage = DAMAGE_NO;
  218.     self.classname = "explo_box";
  219.     // did say self.owner
  220.     T_RadiusDamage (self, self, 160, world);
  221.     sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
  222.     particle (self.origin, '0 0 0', 75, 255);
  223.  
  224.     self.origin_z = self.origin_z + 32;
  225.     BecomeExplosion ();
  226. };
  227.  
  228.  
  229.  
  230. /*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64)
  231. TESTING THING
  232. */
  233.  
  234. void() misc_explobox =
  235. {
  236.     local float    oldz;
  237.     
  238.     self.solid = SOLID_BBOX;
  239.     self.movetype = MOVETYPE_NONE;
  240.     precache_model ("maps/b_explob.bsp");
  241.     setmodel (self, "maps/b_explob.bsp");
  242.     precache_sound ("weapons/r_exp3.wav");
  243.     self.health = 20;
  244.     self.th_die = barrel_explode;
  245.     self.takedamage = DAMAGE_AIM;
  246.     self.flags = FL_OBJECT;            //ws
  247.  
  248.     self.origin_z = self.origin_z + 2;
  249.     oldz = self.origin_z;
  250.     droptofloor();
  251.     if (oldz - self.origin_z > 250)
  252.     {
  253.         dprint ("item fell out of level at ");
  254.         dprint (vtos(self.origin));
  255.         dprint ("\n");
  256.         remove(self);
  257.     }
  258. };
  259.  
  260. /*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64)
  261. Smaller exploding box, REGISTERED ONLY
  262. */
  263.  
  264. void() misc_explobox2 =
  265. {
  266.     local float    oldz;
  267.     
  268.     self.solid = SOLID_BBOX;
  269.     self.movetype = MOVETYPE_NONE;
  270.     precache_model2 ("maps/b_exbox2.bsp");
  271.     setmodel (self, "maps/b_exbox2.bsp");
  272.     precache_sound ("weapons/r_exp3.wav");
  273.     self.health = 20;
  274.     self.th_die = barrel_explode;
  275.     self.takedamage = DAMAGE_AIM;
  276.     self.flags = FL_OBJECT;            //ws
  277.  
  278.     self.origin_z = self.origin_z + 2;
  279.     oldz = self.origin_z;
  280.     droptofloor();
  281.     if (oldz - self.origin_z > 250)
  282.     {
  283.         dprint ("item fell out of level at ");
  284.         dprint (vtos(self.origin));
  285.         dprint ("\n");
  286.         remove(self);
  287.     }
  288. };
  289.  
  290. //============================================================================
  291.  
  292. float SPAWNFLAG_SUPERSPIKE    = 1;
  293. float SPAWNFLAG_LASER = 2;
  294.  
  295. void(vector org, vector vec) LaunchLaser;
  296.  
  297. void() spikeshooter_use =
  298. {
  299.     if (self.spawnflags & SPAWNFLAG_LASER)
  300.     {
  301.         sound (self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM);
  302.         LaunchLaser (self.origin, self.movedir);
  303.     }
  304.     else
  305.     {
  306.         sound (self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM);
  307.         launch_spike (self.origin, self.movedir);
  308.         newmis.velocity = self.movedir * 500;
  309.         if (self.spawnflags & SPAWNFLAG_SUPERSPIKE)
  310.             newmis.touch = superspike_touch;
  311.     }
  312. };
  313.  
  314. void() shooter_think =
  315. {
  316.     spikeshooter_use ();
  317.     self.nextthink = time + self.wait;
  318.     newmis.velocity = self.movedir * 500;
  319. };
  320.  
  321.  
  322. /*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
  323. When triggered, fires a spike in the direction set in QuakeEd.
  324. Laser is only for REGISTERED.
  325. */
  326.  
  327. void() trap_spikeshooter =
  328. {
  329.     SetMovedir ();
  330.     self.use = spikeshooter_use;
  331.     if (self.spawnflags & SPAWNFLAG_LASER)
  332.     {
  333.         precache_model2 ("progs/laser.mdl");
  334.         
  335.         precache_sound2 ("enforcer/enfire.wav");
  336.         precache_sound2 ("enforcer/enfstop.wav");
  337.     }
  338.     else
  339.         precache_sound ("weapons/spike2.wav");
  340. };
  341.  
  342.  
  343. /*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
  344. Continuously fires spikes.
  345. "wait" time between spike (1.0 default)
  346. "nextthink" delay before firing first spike, so multiple shooters can be stagered.
  347. */
  348. void() trap_shooter =
  349. {
  350.     trap_spikeshooter ();
  351.     
  352.     if (self.wait == 0)
  353.         self.wait = 1;
  354.     self.nextthink = self.nextthink + self.wait + self.ltime;
  355.     self.think = shooter_think;
  356. };
  357.  
  358.  
  359.  
  360. /*
  361. ===============================================================================
  362.  
  363.  
  364. ===============================================================================
  365. */
  366.  
  367.  
  368. void() make_bubbles;
  369. void() bubble_remove;
  370. void() bubble_bob;
  371.  
  372. /*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8)
  373.  
  374. testing air bubbles
  375. */
  376.  
  377. void() air_bubbles =
  378.  
  379. {
  380.     if (deathmatch)
  381.     {
  382.         remove (self);
  383.         return;
  384.     }
  385.     precache_model ("progs/s_bubble.spr");
  386.     self.nextthink = time